﻿<%@ Page Language="C#" MasterPageFile="../Share/Default.master" AutoEventWireup="true"
    CodeFile="power.aspx.cs" Inherits="User_power" Title="无标题页" %>

<%@ Register Assembly="ClickOnceButton" Namespace="FreeHouse.Web.Controls" TagPrefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">

    <script src="../js/jquery-1.4.2.min.js" type="text/javascript"></script>

    <script src="../js/power.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="body" runat="Server">
    <table width="90%">
        <tr>
            <th>
                选择用户所属角色
            </th>
        </tr>
        <tr>
            <td>
                <asp:Repeater ID="roles" runat="server" onitemdatabound="roles_ItemDataBound">
                    <HeaderTemplate>
                        <table class="gvList" align="left">
                            <tr>
                                <th>
                                    角色名称
                                </th>
                                <th>
                                    角色介绍
                                </th>
                            </tr>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr>
                            <td>
                                <input class="role" name="role" id="role<%#Eval("RoleId") %>" type="checkbox" value="<%#Eval("RoleId") %>" />
                                <label for="role<%#Eval("RoleId") %>">
                                    <%#Eval("RoleName")%></label>
                            </td>
                            <td>
                                <%#Eval("RoleDescription")%>
                            </td>
                        </tr>
                        <tr  style="display:none">
                            <th colspan="2">
                                <table align="left">
                                     <tr>
                                        <th colspan="2">说明:勾选则用户不具有此项权限</th>
                                    </tr>
                                    <tr>
                                        <th class="editActions">
                                            <a href="#">编辑Action</a>
                                        </th>
                                        <th class="editFields">
                                            <a href="#" >编辑Fields</a>
                                        </th>
                                    </tr>
                                    
                                    <tr style="display:none">
                                        <th colspan="2" >
                                            <asp:Repeater ID="actions" runat="server">
                                                <HeaderTemplate>
                                                    <table align="left">
                                                </HeaderTemplate>
                                                <ItemTemplate>
                                                    <tr>
                                                        <td><input id="action_<%#Eval("roleid") %>_<%#Eval("actionid") %>" type="checkbox" name="action<%#Eval("roleid") %>" value="<%#Eval("ActionID") %>" /></td>
                                                        <td><label for="action_<%#Eval("roleid") %>_<%#Eval("actionid") %>"><%#Eval("ClassName")%>.<%#Eval("MethodName")%>()</label></td>
                                                        <td><%#Eval("Description")%></td>
                                                    </tr>
                                                </ItemTemplate>
                                                <FooterTemplate></table></FooterTemplate>
                                            </asp:Repeater>
                                        </th>
                                    </tr>
                                    <tr  style="display:none">
                                        <td colspan="2">
                                        <asp:Repeater ID="fields" runat="server">
                                                <HeaderTemplate>
                                                    <table>
                                                </HeaderTemplate>
                                                <ItemTemplate>
                                                    <tr>
                                                        <td><input id="field_<%#Eval("RoleId") %>_<%#Eval("fieldid") %>" type="checkbox" name="field<%#Eval("roleid") %>" value="<%#Eval("fieldid") %>" /></td>
                                                        <td><label for="field_<%#Eval("RoleId") %>_<%#Eval("fieldid") %>"><%#Eval("modelname")%>.<%#Eval("fieldname")%></label></td>
                                                        <td><%#Eval("description")%></td>
                                                    </tr>
                                                </ItemTemplate>
                                                <FooterTemplate></table></FooterTemplate>
                                            </asp:Repeater>
                                        </td>
                                    </tr>
                                </table>
                            </th>
                        </tr>

                    </ItemTemplate>
                    <FooterTemplate>
                        </table>
                    </FooterTemplate>
                </asp:Repeater>
            </td>
        </tr>
        <tr>
            <td>
                <cc1:ClickOnceButton ID="save" runat="server" Text="保存" 
                    AfterSubmitText="请稍候..." onclick="save_Click" />
                &nbsp;<cc1:ClickOnceButton ID="cancel" runat="server" Text="返回用户管理" 
                    AfterSubmitText="请稍候..." onclick="cancel_Click" /></td>
        </tr>
    </table>
</asp:Content>
